package com.lc.hongtai.dialogs;

import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;

import com.lc.hongtai.MyApplication;
import com.lc.hongtai.R;
import com.zcx.helper.bound.BoundViewHelper;

/**
 * Created by Administrator on 2017/2/21.
 */
public abstract class PictureDialog extends BaseDialog {

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        BoundViewHelper.boundView(this, MyApplication.scaleScreenHelper.loadView((ViewGroup) getWindow().getDecorView()));

        getWindow().setGravity(Gravity.BOTTOM);


    }
    public PictureDialog(Context context) {
        super(context);

        setContentView(R.layout.pop_select_photo);

        View.OnClickListener listener = new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                switch (v.getId()) {

                    case R.id.camera_tv:

                        onCamera();

                        break;

                    case R.id.album_tv:

                        onAlbum();

                        break;

                }

                dismiss();

            }
        };

        findViewById(R.id.camera_tv).setOnClickListener(listener);
        findViewById(R.id.album_tv).setOnClickListener(listener);
        findViewById(R.id.cancle_tv).setOnClickListener(listener);

        show();

    }

    public abstract void onAlbum();
    public abstract void onCamera();
}
